<template>
	<div class="container">
		<h2 style="text-align:center;margin-bottom: 12px;">查看商砼预约</h2>
		<a-form>
			<a-row :gutter="20">
				<a-col :span="12">
					<a-form-item label="项目名称">
						{{ info.project?.name }}
					</a-form-item>
				</a-col>
				<a-col :span="12">
					<a-form-item label="预计浇筑部位">
						{{ info.part }}
					</a-form-item>
				</a-col>

				<a-col :span="12">
					<a-form-item label="砼标号（类别）">
						{{ info.type }}
					</a-form-item>
				</a-col>
				<a-col :span="12">
					<a-form-item label="预计浇筑方量（m3）">
						{{ info.fangliang }}
					</a-form-item>
				</a-col>
				<a-col :span="12">
					<a-form-item label="是否泵送（长度）">
						{{ info.changdu }}
					</a-form-item>
				</a-col>
				<a-col :span="12">
					<a-form-item label="申请塌落度（mm）">
						{{ info.luodu }}
					</a-form-item>
				</a-col>
				<a-col :span="12">
					<a-form-item label="现场联系人">
						{{ info.contacts }}
					</a-form-item>
				</a-col>
				<a-col :span="12">
					<a-form-item label="现场联系电话">
						{{ info.tel }}
					</a-form-item>
				</a-col>
					
				<a-col :span="12">
					<a-form-item label="预计浇筑日期">
						{{ info.add_time }}
					</a-form-item>
				</a-col>

				<a-col :span="24">
					<a-form-item label="备注" name="memo">
						{{ info.memo }}
					</a-form-item>
				</a-col>
			</a-row>

			<a-row :gutter="20">
				<a-col :span="24" class="py-4 text-center">
					<a-space>
						<a-button @click="closeTab('/shangtong')">
							<close-outlined />关闭
						</a-button>
					</a-space>
				</a-col>
			</a-row>
		</a-form>
	</div>
</template>

<script setup>
import { ref, computed, onMounted, getCurrentInstance, inject } from "vue";
import { post } from "../utils";
import { useRoute } from "vue-router";
import { CloseOutlined } from "@ant-design/icons-vue";
const route = useRoute();
const id = computed(() => {
	return route.params.id || 0;
});
import dayjs from "dayjs";

const info = ref({})
onMounted(() => {
	post("shangtong/info", { id: id.value }).then(data => {
		data.add_time = dayjs(data.add_time).format("YYYY-MM-DD HH:mm:ss");
		info.value = data;
	});
});


const closeTab = inject("closeTab");
</script>

<style scoped lang="scss">
.container {
	background: #fff;
	padding: 20px;
}
</style>
